package wli.web.util;

import java.io.*;
import java.util.*;

public class MySaveFile {

    private static RandomAccessFile outputFile; 

    public static void createFile(String dirName, String fileName)
    {

	File file = new File (dirName, fileName);

	try {
	    if (file.exists()) {
		System.out.println("File: "+file.getName()+" is existing");
		System.exit(0);
	    }
	    else {
		outputFile = new RandomAccessFile( file, "rw" );
		System.out.println("File: "+file.getName()+" has been created");
	    }
	}
	catch ( IOException e ) {
	}
    }

    public static void addContentToFile(String sb) {

       try {
	   outputFile.writeBytes(sb);
	   outputFile.close();
	   System.out.println("File has been saved");
       }
       catch ( IOException io ) {
       }
    }
}






